<?php

namespace app\wechat\controller;

use Ofcold\IdentityCard\IdentityCard;

/**
 * Class App
 * @package app\wechat\controller
 */
class App extends \think\Controller
{
    public function idcard()
    {
        $arr = $this->ioAll();
        $idCard = IdentityCard::make($arr['idCard'], 'zh-cn');
        if ($idCard === false) {
            return $this->fail('Your ID number is incorrect');
        }
        return $this->ok($idCard->toArray());
    }
}
